﻿using App.Code;
using App.IServices;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace AppAit.Areas.SystemSecurity.Controllers
{
    public class FilterIPController : ControllerBase
    {

        ISys_FilterIPServices _iFilterIPServices;
        public FilterIPController(ISys_FilterIPServices iFilterIPServices)
        {
            _iFilterIPServices = iFilterIPServices;
        }


       

        [HttpGet]
        [HandlerAjaxOnly]
        public ActionResult GetGridJson(string keyword)
        {
            var data = _iFilterIPServices.GetList(keyword);
            return Content(data.ToJson());
        }
        [HttpGet]
        [HandlerAjaxOnly]
        public ActionResult GetFormJson(string keyValue)
        {
            var data = _iFilterIPServices.GetForm(keyValue);
            return Content(data.ToJson());
        }
        [HttpPost]
        [HandlerAjaxOnly]
        [ValidateAntiForgeryToken]
        public ActionResult SubmitForm(App.Entity.Sys_FilterIP filterIPEntity, string keyValue)
        {
            _iFilterIPServices.SubmitForm(filterIPEntity, keyValue);
            return Success("操作成功。");
        }
        [HttpPost]
        [HandlerAjaxOnly]
        [HandlerAuthorize]
        [ValidateAntiForgeryToken]
        public ActionResult DeleteForm(string keyValue)
        {
            _iFilterIPServices.DeleteForm(keyValue);
            return Success("删除成功。");
        }
    }
}